// 同时请求,全部完成后返回结果, 并发请求方法
// 127.0.0.1:3000/proxy/all/s?query=[{"path":"serveruser\/user\/User\/login","param":{"phone":"13181262939","login_password":"12345678","token":"b49baca86cf59b174feae087a63d8656"}}]
// 127.0.0.1:3000/proxy/all/s?query=[{"path":"serveruser\/user\/User\/list","param":{"page":"1","list_rows":"15"}}]
// 127.0.0.1:3000/proxy/all/s?query=[{"path":"serveruser\/user\/User\/list","param":{"page":"1","list_rows":"15"}},{"path":"serveruser\/user\/User\/info","param":{"id":"1"}}]&success=1,0
// post方式  127.0.0.1:3000/proxy/all
// {"query":[{"path":"serveruser/user/User/list","param":{"page":"1","list_rows":"15"}},{"path":"serveruser/user/User/info","param":{"id":"1"}}],"success":"1,0"}

const express = require('express')
const router = express.Router()

// 获取get参数
const getParam = require('../dispatch/getParam')
// 获取post参数
const postParam = require('../dispatch/postParam')
// 引入并发请求方法
const allQuery = require('../dispatch/allQuery')
// 获取upload的请求方法

router.get('/', function(req, res, next) {
    let {query, successArr} = getParam(req, res, next)
    allQuery(req, res, next, query, successArr)
})


router.post('/', function(req, res, next) {
    let {query, successArr} = postParam(req, res, next)
    allQuery(req, res, next, query, successArr)
})

module.exports = router
